// ============================================================================
//
// Copyright (C) 2006-2007 Dengues
//
// Google Group: http://groups.google.com/group/dengues
// QQ Group: 24885404
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ============================================================================
package org.dengues.ui.prefs;

import org.dengues.commons.DenguesCommonsPlugin;
import org.dengues.commons.ui.swt.colorstyledtext.BooleanColorFieldEditor;
import org.dengues.commons.ui.swt.colorstyledtext.ColorManager;
import org.dengues.core.i18n.Messages;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

/**
 * Qiang.Zhang.Adolf@gmail.com class global comment. Detailled comment <br/>
 * 
 * $Id: Dengues.epf 2007-11-23 qiang.zhang $
 * 
 */
public class CodeColorPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

    /**
     * Qiang.Zhang.Adolf@gmail.com CodeColorPreferencePage constructor comment.
     */
    public CodeColorPreferencePage() {
        super(FieldEditorPreferencePage.GRID);
        setPreferenceStore(DenguesCommonsPlugin.getDefault().getPreferenceStore());

    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
     */
    public void init(IWorkbench workbench) {

    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
     */
    @Override
    protected void createFieldEditors() {
        Composite p = getFieldEditorParent();
        String b = Messages.getString("CodeColorPreferencePage.bold"); //$NON-NLS-1$
        addField(new BooleanColorFieldEditor(ColorManager.NULL_COLOR, "Default", ColorManager.NULL_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.KEYWORD1_COLOR, "Keyword1", ColorManager.KEYWORD1_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.KEYWORD2_COLOR, "Keyword2", ColorManager.KEYWORD2_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.KEYWORD3_COLOR, "Keyword3", ColorManager.KEYWORD3_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.COMMENT1_COLOR, "Commont1", ColorManager.COMMENT1_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.COMMENT2_COLOR, "Commont2", ColorManager.COMMENT2_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.LITERAL1_COLOR, "Literal1", ColorManager.LITERAL1_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.LITERAL2_COLOR, "Literal2", ColorManager.LITERAL2_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.LABEL_COLOR, "Label", ColorManager.LABEL_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.FUNCTION_COLOR, "Function", ColorManager.FUNCTION_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.MARKUP_COLOR, "Markup", ColorManager.MARKUP_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.OPERATOR_COLOR, "Operator", ColorManager.OPERATOR_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.DIGIT_COLOR, "Digit", ColorManager.DIGIT_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
        addField(new BooleanColorFieldEditor(ColorManager.INVALID_COLOR, "Invalid", ColorManager.INVALID_COLOR //$NON-NLS-1$
                + ColorManager.BOLD_SUFFIX, b, p));
    }

}
